//
//  MCDiscountPayCell.swift
//  StoreManage
//
//  Created by MC on 2017/12/19.
//  Copyright © 2017年 MC. All rights reserved.
//

import UIKit

class MCMyCommissionCell: UITableViewCell {
    
    
    var model : MCMyCommissionModel = MCMyCommissionModel() {
        didSet {

            timeLabel.text = model.createTime
            explainLabel.text = model.comment
            moneyLabel.text = model.type + MCString_judgemantDecimalsIsZero(figure: model.money.intValue)
            
            orderLabel.text = "订单号:" + model.orderSn
        }
    }
    
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        backgroundColor = UIColor.MCGray_light
        
        self.addSubview(orderLabel)
        orderLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(20)
            make.bottom.equalTo(self.snp.centerY).offset(-3)
        }
        
        self.addSubview(moneyLabel)
        moneyLabel.snp.remakeConstraints { (make) ->Void in
            make.right.equalTo(-20)
            make.bottom.equalTo(self.snp.centerY).offset(-3)
        }

        self.addSubview(timeLabel)
        timeLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(20)
            make.top.equalTo(self.snp.centerY).offset(3)
        }

        self.addSubview(explainLabel)
        explainLabel.snp.remakeConstraints { (make) ->Void in
            make.right.equalTo(-20)
            make.top.equalTo(self.snp.centerY).offset(3)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    lazy var orderLabel : UILabel = {
        let label = UILabel()
        label.textColor = UIColor.MCWords
        label.font = MCFont(14)
        label.text = "订单号:"
        return label
    }()
    
    lazy var timeLabel : UILabel = {
        let label = UILabel()
        label.textColor = UIColor.MCWords
        label.font = MCFont(14)
        return label
    }()
    
    lazy var moneyLabel : UILabel = {
        let label = UILabel()
        label.textColor = UIColor.MCAssist
        label.font = MCFont(14)
        return label
    }()
    
    lazy var explainLabel : UILabel = {
        let label = UILabel()
        label.textColor = UIColor.MCWords
        label.font = MCFont(14)
        return label
    }()
}



